/**
* move
*/
#include <iostream>
#include <utility>
#include <vector>
#include <map>

int main() {
    std::map<int, std::vector<int>> m = {
            {1, {1}},
            {2, {2}},
            {3, {3}}
    };
    std::vector<int> vec{1, 2, 3};
    //调用常规的拷贝构造函数，新建字符数组，拷贝数据
    for (auto &i: vec) {
        auto tmp1 = m[i];
        auto tmp2 = std::move(tmp1);

        auto tmp3 = std::move(m[i]);
        std::cout << tmp2[0] << " " << m[i].size() << " " << tmp3[0] << " " << tmp1.size() << "\n";
    }
    return 0;
}

int demo() {
    std::map<int, std::vector<int>> m = {
            {1, {1}},
            {2, {2}},
            {3, {3}}
    };
    std::vector<int> vec{1, 2, 3};
    //调用常规的拷贝构造函数，新建字符数组，拷贝数据
    for (auto &i: vec) {
        auto tmp = m[i];
        std::cout << tmp.size() << "\n";
    }
    for (auto &i: vec) {
        auto tmp =std::move(m[i]);
        std::cout << tmp.size() << "\n";
    }
    return 0;
}
